﻿let merge = require("webpack-merge");
let prodEnv = require("./prod.env");

const proxyUrls = {
    ["admin-api"]: "https://enrollment.yulaisoft.com", // admin应用代理url
    ["h5-api"]: "https://enrollment.yulaisoft.com", // H5url
    // ["user-api"]: "http://192.168.2.25:8888", //权限
    // ["yyc-phone"]: "http://192.168.2.230:8531", // 杨远超 校园电话应用代理url
    // ["yyc-hk"]: "http://192.168.2.230:8527", // 杨远超 admin应用代理url 海康
    // ["yyc-pay"]: "http://192.168.2.230:8530", // 杨远超 admin应用代理url 校园收费
    // ["yyc"]: "http://192.168.2.230:8529", // 杨远超 admin应用代理url 基础服务
};
module.exports = merge(prodEnv, {
    NODE_ENV: '"development"',
    serviceUrl: proxyUrls,
    proxyTable: (function () {
        let obj = {};
        Object.keys(proxyUrls).forEach((key) => {
            obj["/" + key] = {
                target: proxyUrls[key], // api代理服务器地址http://ip:port
                changeOrigin: true,
                // projectName: 'governor', // 项目名称，配置该选项，请求的url会加上项目名称，比如/api/common/get-data => /api/projectName/common/get-data
                pathRewrite: {
                    ["^/" + key]: "",
                },
            };
        });
        return {
            ...obj,
        };
    })(),
});
